package com.suzhe.ymall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.suzhe.ymall.common.enums.MessageStatusEnum;
import com.suzhe.ymall.order.enums.OrderStatusEnum;
import com.suzhe.ymall.order.param.SubmitOrderParam;
import com.suzhe.ymall.order.pojo.Order;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author suzhe
 * @since 2019-08-08
 */
public interface IOrderService extends IService<Order> {

    Order createOrder(SubmitOrderParam submitOrderParam);

    boolean updateActualPay(String orderNo,Long actualPay);


    boolean updateOrderStatus(String orderNo, OrderStatusEnum orderStatusEnum);

    /**
     * 发送废单消息
     * @param orderNo
     * @return
     */
    void sendOrderRollbackMessage(String orderNo);


    /**
     * 发送订单延迟消息：10分钟未支付的订单，则自动取消
     * 1到18分别对应1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h
     * @param orderNo
     */
    void sendScheduledOrderMessage(String orderNo);

    boolean paySuccess(String messageId,String orderNo);

    boolean updateMessageStatus(String messageId, MessageStatusEnum messageStatusEnum);


}
